@extends('mobile')
@section('style')
    <style>
        .button {
            text-align: center;
            padding: 20px;
            background: #093;
            color: #fff;
            font-size: 1.5em;
        }
        .button a{
            color: #fff;;
        }
    </style>
@stop
@section('content')
    <div class="wap_box">
        <div class="lgywm_title">
            <div class="xian"></div>
            <div class="lwenzi">
                <p><strong>新闻中心</strong></p>
            </div>
        </div>
        <div class="news_con">
            <ul class="news_c_list clearfix">
                {{--新闻空间--}}
            </ul>
        </div>
        <p class="button more"><a href="javascript:;">查看更多</a></p>
    </div>
@stop
@section('js')
    <script>
        var __url = "{{url('/mobile/news/list')}}";
        $(function () {
            getList();
            $('.more').on('click', function () {
                getList();
            });
        });
        function getList() {
            $.get(__url, function (data) {
                $.each(data.data, function (key, val) {
                    var __html = '<li><span class="float_r">' + val.created_at.slice(0,10) + '</span><a href="{{url('/mobile/news/detail')}}/' + val.id + '">' + val.name + '</a></li>';
                    $('.news_c_list').append(__html);
                });
                if (null == data.next_page_url) {
                    $('.more').remove();
                } else {
                    __url = data.next_page_url;
                }
            })
        }
    </script>
@stop